//package com.zmn.plat.admin.controller.base.maintainitem;
//
//import com.alibaba.fastjson.JSONArray;
//import com.zmn.common.dictionary.GlobalDict;
//import com.zmn.common.dto.VtDTO;
//import com.zmn.common.utils.number.NumberUtil;
//import com.zmn.common.utils.string.StringUtil;
//import com.zmn.plat.admin.controller.PlatBaseController;
//import com.zmn.plat.model.entity.base.maintainitem.MaintainItem;
//import com.zmn.plat.model.entity.base.maintainitem.MaintainItemQuery;
//import com.zmn.plat.services.interfaces.base.maintainitem.MaintainItemService;
//import lombok.extern.slf4j.Slf4j;
//import org.apache.shiro.authz.annotation.RequiresPermissions;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RestController;
//import org.springframework.web.servlet.ModelAndView;
//
//import javax.annotation.Resource;
//import java.util.List;
//
//
///**
// * 检修项目基础查询Controller
// *
// * @author chengguang
// * @since 2021/11/19 14:45
// */
//@Slf4j
//@RestController
//@RequestMapping("/base/maintainItem")
//public class MaintainItemListController extends PlatBaseController {
//
//    @Resource
//    private MaintainItemService maintainItemService;
//
//    /**
//     * 描述: 查询列表
//     *
//     * @author chengguang
//     * @since 2021/11/19 14:45
//     */
//    @RequestMapping("/list")
//    @RequiresPermissions("/base/maintainItem/list.action")
//    public ModelAndView list(MaintainItemQuery query) {
//        ModelAndView mv = new ModelAndView("base/maintainitem/list");
//        try {
//            List<MaintainItem> items = maintainItemService.listPageByQuery(query);
//            mv.addObject("items", items);
//            mv.addObject("vo", query);
//        } catch (Exception e) {
//            log.error("查询失败,原因:{}, MSG:{}", e, e.getMessage());
//        }
//        return mv;
//    }
//
//    /**
//     * 描述: 详情
//     *
//     * @author chengguang
//     * @since 2021/11/19 14:45
//     */
//    @RequestMapping("/addEditView")
//    @RequiresPermissions("/base/maintainItem/addEditView.action")
//    public ModelAndView addEditView(Integer maintainId) {
//        ModelAndView mv = new ModelAndView("base/maintainitem/detail");
//        MaintainItem maintainItem;
//        try {
//            if (NumberUtil.isNullOrZero(maintainId)) {
//                maintainItem = new MaintainItem();
//            } else {
//                maintainItem = maintainItemService.findById(maintainId);
//            }
//            if (StringUtil.isNotBlank(maintainItem.getSelectValue())) {
//                List<VtDTO> purchaseOrders = JSONArray.parseArray(maintainItem.getSelectValue(), VtDTO.class);
//                for (int i = 0; i < purchaseOrders.size(); i++) {
//                    mv.addObject("selectValue" + i, purchaseOrders.get(i).getText());
//                    mv.addObject("isNormal"+(i+1), purchaseOrders.get(i).getStatus());
//                }
//            }else{
//                mv.addObject("isNormal1", true);
//            }
//            mv.addObject("maintainItem", maintainItem);
//        } catch (Exception e) {
//            log.error("查询失败,Exception{},msg{}", e, e.getMessage());
//        }
//
//        return mv;
//    }
//
//}
